package com.ocom.ugcapi.controller;

import com.ocom.common.request.payhandle.BackPayRequest;
import com.ocom.common.utils.ContextUtils;
import com.ocom.ugcapi.client.PayHandleClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

/**
 * @Description: TODO
 * @Author: 朱晖
 * @Date: 2023/3/4
 **/
@RestController
public class TestController {

	@Autowired
	private PayHandleClientService payHandleClientService;

	@GetMapping("/56789")
	public Object yh(){

//		String mqKey = "MqSimple:checkWithhold:"+ RandomUtil.getRandomString(20);
//		QrCodeRefundRequest qrCodeRefundRequest =new QrCodeRefundRequest();
//		qrCodeRefundRequest.setCompanyId(52l);
//		qrCodeRefundRequest.setMachNo("00000000");
//		qrCodeRefundRequest.setOrigTradeNo("DK17192958446446012527131test");
//		qrCodeRefundRequest.setTradeNo("DK17192958446446012527131return");
//		qrCodeRefundRequest.setRefundAmount(1);
//		redisUtil.set(mqKey, qrCodeRefundRequest,60l*10l*1000l);
//		checkWithholdRefundProduct.sendDelayMessage(mqKey);
//		return true;

		HttpServletRequest request= ContextUtils.getRequest();
//		BackPayRequest backPayRequest=new BackPayRequest();
//		payHandleClientService.backPay(backPayRequest);
		Map<String ,Object> resMap =new HashMap<>();
		resMap.put("userAgent",request.getHeader("User-Agent"));

		return  resMap;
	}
}
